"""
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    created by lane.chang on '20/11/2024'
    comment: 卡片服务相关接口
"""
import asyncio
from fastapi import UploadFile

from config import Config
from project.model.micro_service import MicroService


class Gaea:

    @staticmethod
    async def do_knowledge_data_file_import(files: list[UploadFile], organization_code, task_id='', hook_url=''):
        """ 知识库文件导入
        :param files:
        :param organization_code:
        :param task_id:
        :param hook_url:
        :return:
        """
        await MicroService(domain=Config.GAEA_SERVER,
                           headers={'Content-Type': 'multipart/form-data'}).post_form_data(url_path='/knowledge/file/import',
                                                                                           files=files,
                                                                                           organization_code=organization_code,
                                                                                           task_id=task_id,
                                                                                           hook_url=hook_url)


if __name__ == "__main__":

    asyncio.run(Gaea.do_knowledge_data_file_import(files=[], organization_code='01'))
